import { useState, useEffect } from 'react'
import { articleGetChannelListService } from '@/api/article'

const useChannel = () => {
  const [channelList, setChannelList] = useState([])
  useEffect(() => {
    articleGetChannelListService().then((res) => {
      setChannelList(res.data.channels)
    })
  }, [])
  return {
    channelList
  }
}
export { useChannel }
